import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    children:[
      {
        path: '/add',
        name: 'add',
        component: () => import('../views/add.vue')
      },
      {
        path: '/from',
        name: 'from',
        component: () => import('../views/from.vue')
      },
      {
        path: '/mag',
        name: 'mag',
        component: () => import('../views/mag.vue')
      },
      {
        path: '/name',
        name: 'name',
        component: () => import('../views/name.vue')
      }
    ]
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/About.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
